//
// Created by wangwanlong on 2024/11/1.
//

#ifndef MKAHYPAR_RATING_COMMUNITY_POLICY_H
#define MKAHYPAR_RATING_COMMUNITY_POLICY_H
#include "mkahypar/utils/typedef.h"
#include "mkahypar/utils/macros.h"
#include "mkahypar/utils/policy_registry.h"
//同一个社区缩合
namespace mkahypar{
  class UseCommunityStructure final : public meta::PolicyBase {
  public:
    MKAHYPAR_ATTRIBUTE_ALWAYS_INLINE static inline bool sameCommunity(const std::vector<PartitionID>& communities,
                                                                     const HypernodeID u, const HypernodeID v) {
      return communities[u] == communities[v];
    }
  };

  class IgnoreCommunityStructure final : public meta::PolicyBase {
  public:
    MKAHYPAR_ATTRIBUTE_ALWAYS_INLINE static inline bool sameCommunity(const std::vector<PartitionID>&,
                                                                     const HypernodeID, const HypernodeID) {
      return true;
    }
  };
}
#endif //MKAHYPAR_RATING_COMMUNITY_POLICY_H
